﻿using SD.Infrastructure.Repository.EntityFrameworkCore;
using SlamDunk.MES.Domain.Entities.AcquisitionContext;
using SlamDunk.MES.Domain.IRepositories.Interfaces.AcquisitionContext;
using System;
using System.Collections.Generic;
using System.Linq;

namespace SlamDunk.MES.Repository.Implements.AcquisitionContext
{
    /// <summary>
    /// 采集记录仓储实现
    /// </summary>
    public class AcquisitionRecordRepository : EFEntityRepositoryProvider<AcquisitionRecord>, IAcquisitionRecordRepository
    {
        #region # 获取采集记录列表 —— ICollection<AcquisitionRecord> Find(Guid acquisitionSessionId)
        /// <summary>
        /// 获取采集记录列表
        /// </summary>
        /// <param name="acquisitionSessionId">采集会话Id</param>
        /// <returns>采集记录列表</returns>
        public ICollection<AcquisitionRecord> Find(Guid acquisitionSessionId)
        {
            IQueryable<AcquisitionRecord> records = base.Find(x => x.AcquisitionSession.Id == acquisitionSessionId);

            return records.ToList();
        }
        #endregion
    }
}
